package com.huanletao.spring.data;

import com.huanletao.crypto.SM2Utils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.security.KeyPair;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @package: com.huanletao.spring.data
 * @Description:
 * @className: demo1
 * @author: @NNCSKJ ADMIN
 * @copyright: Copyright (c) 2022/7/29 11:46
 * @version: V1.0
 */
public class demo1 {
    public static void main(String[] args) throws ParseException {
        Integer a = 1;
        Integer b = 2;
        Integer c = null;
        Boolean flag = false;
// a*b 的结果是 int 类型，那么 c 会强制拆箱成 int 类型，抛出 NPE 异常
        Integer result=(flag? (Integer) (a*b) : c);


        String str = "default";
        System.out.println(StringUtils.containsNone(str, "#"));

        String data = "2022-08-02";
        Date date = DateUtils.parseDate(data, "yyyy-MM-dd");
        int i = DateUtils.truncatedCompareTo(new Date(), date, Calendar.DAY_OF_MONTH);
        System.out.println("i = " + i);
//        int compare = StringUtils.compare("default", str)!=0;
//        System.out.println("compare = " + compare);
    }
}
